package com.jyu.apts.entity;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.jyu.apts.entityEnum.ItemBatchRecordStatusEnum;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name="itemBatchRecord")
public class ItemBatchRecord {
	@Id
	@GeneratedValue(strategy=GenerationType.SEQUENCE)
	long id;//主键
	
	@Column
	long count;
	
	@Column
	Integer status = ItemBatchRecordStatusEnum.WORKING.getType();
	
	@OneToMany(mappedBy="itemBatchRecord",cascade={CascadeType.REMOVE})//级联删除流程
	List<ItemProcessRecord> itemProcessRecords;
	
	@OneToMany(mappedBy="itemBatchRecord",cascade={CascadeType.REMOVE})//级联删除流程
	List<QRCode> originQRCodes;
		
	@ManyToOne
	ItemProductionLine itemProductionLine;
	
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public long getId() {
		return id;
	}
}
